<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="robots" content="noindex,nofollow">
    {% block head %}{% endblock %}
    <link href="{{ url_for('static', filename='vendors/bootstrap/bootstrap.min.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='vendors/font-awesome/css/font-awesome.min.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='vendors/nprogress/nprogress.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='css/admin.min.css') }}" rel="stylesheet">
    <link rel="shortcut icon" type="image/x-icon" href="{{ url_for('static', filename='images/urukp.png') }}">
    <style type="text/css">
      .navbar-nav .open .dropdown-menu.msg_list {
        width: 160px;
      }
    </style>
    {% if session["direction"] == "rtl" %}
      <style type="text/css">
        .nav-sm .main_container .top_nav {
          margin-left: 0 !important;
          margin-right: 70px !important;
        }
        .nav-sm ul.nav.child_menu {
          right: 100%;
        }
        .nav-md .container.body .right_col, .main_container .top_nav {
          margin-right: 230px !important;
          margin-left: 0 !important;
        }
        footer {
          margin-right: auto !important;
          margin-left: auto !important;
        }
        .navbar-right, .main_menu span.fa, .top_nav .navbar-right li {
          float: left !important;
        }
        td, th {
          text-align: right !important;
        }
        .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-55, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .profile_pic, .toggle, .x_title h2, .page-title .title_left {
          float: right !important;
        }
        .img-circle.profile_img {
          margin-right: 15%;
        }
        .nav {
          padding-right: 0;
        }
        .nav.child_menu li {
          padding-right: 36px;
        }
        .nav-sm .container.body .right_col {
          margin-right: 70px !important;
          margin-left: 0 !important;
        }

        .site_title {
          padding-right: 10px !important;
        }
        .navbar-nav .open .dropdown-menu {
          right: auto;
          left: 0;
        }
        .top_nav .dropdown-menu li a {
          text-align: right;
          direction: rtl;
        }
      </style>
    {% endif %}
  </head>
  {% if session["direction"] == "rtl" %}
    <body class="nav-md" dir="rtl">
  {% else %}
    <body class="nav-md" dir="ltr">
  {% endif %}
    <div class="container body">
      <div class="main_container">
        <div class="col-md-3 left_col">
          <div class="left_col scroll-view">
            <div class="navbar nav_title" style="border: 0;">
              <a href="{{ url_for('admin.index') }}" class="site_title"><i class="fa fa-tachometer"></i> <span>{{ _("Control Panel") }}</span></a>
            </div>
            <div class="clearfix"></div>
            <div class="profile clearfix">
              <div class="profile_pic">
                <img src="{{ url_for('static', filename='images/user.png') }}" alt="{{ _('user avatar') }}" class="img-circle profile_img">
              </div>
              <div class="profile_info">
                <span>{{ _("Welcome,") }}</span>
                <h2>{{ session.current_user.username }}</h2>
              </div>
              <div class="clearfix"></div>
            </div>
            <br/>
            <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
              <div class="menu_section">
                <ul class="nav side-menu">
                  <li><a href="{{ url_for('admin.index') }}"><i class="fa fa-home"></i> {{ _("Home") }}</a></li>
                  <li><a><i class="fa fa-wikipedia-w"></i> {{ _("Wiki") }}<span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                      <li><a href="{{ url_for('admin.add_post') }}">{{ _("Add") }}</a></li>
                      <li><a href="{{ url_for('admin.posts') }}">{{ _("Wiki Posts") }}</a></li>
                      <li><a href="{{ url_for('admin.queue_posts') }}">{{ _("Queue Wiki Posts") }}</a></li>
                    </ul>
                  </li>                  
                  <li><a href="{{ url_for('admin.users') }}"><i class="fa fa-user"></i> {{ _("Users") }}</a></li>
                  <li><a href="{{ url_for('admin.settings') }}"><i class="fa fa-cog"></i> {{ _("Settings") }}</a></li>
                </ul>
              </div>
            </div>
            <div class="sidebar-footer hidden-small">
              <a style="width: 50% !important" data-toggle="tooltip" data-placement="top" title="{{ _('Logout') }}" href="{{ url_for('wiki.logout') }}">
                <span class="glyphicon glyphicon-off" aria-hidden="true"></span>
              </a>
              <a style="width: 50% !important" data-toggle="tooltip" data-placement="top" title="{{ _('Home') }}" href="{{ url_for('wiki.index') }}">
                <span class="fa fa-home" aria-hidden="true"></span>
              </a>
            </div>
          </div>
        </div>
        <div class="top_nav">
          <div class="nav_menu">
            <nav>
              <div class="nav toggle">
                <a id="menu_toggle"><i class="fa fa-bars"></i></a>
              </div>
              <ul class="nav navbar-nav navbar-right">
                <li class="">
                  <a class="user-profile" href="{{ url_for('wiki.user_profile', username=session.current_user.username) }}">
                    <img src="{{ url_for('static', filename='images/user.png') }}" alt="{{ _('user avatar') }}">
                    {{ session.current_user.username }}
                  </a>
                </li>
                <li role="presentation" class="dropdown">
                  <a href="javascript:;" class="dropdown-toggle info-number" data-toggle="dropdown" aria-expanded="false">
                    <i class="fa fa-language"></i>
                    <span class="badge bg-green">{{ len(config["LANGUAGES"].keys()) }}</span>
                  </a>
                  <ul id="menu1" class="dropdown-menu list-unstyled msg_list" role="menu">
                    {% for lang in sorted(config["LANGUAGES"].keys()) %}
                      <li>
                        <a style="color: #000 !important" href="{{ url_for('wiki.langchanger', lang=lang[0:2].lower()) }}">
                          <span class="image"><i class="fa fa-globe"></i></span>
                          <span>{{ _(lang) }}</span>
                        </a>
                      </li>
                    {% endfor %}
                  </ul>
                </li>
             </nav>
          </div>
        </div>
        {% block body %}{% endblock %}
        <footer>
          <div class="clearfix"></div>
        </footer>
      </div>
    </div>
    <script src="{{ url_for('static', filename='vendors/jquery/jquery.min.js') }}"></script>
    <script src="{{ url_for('static', filename='vendors/bootstrap/bootstrap.min.js') }}"></script>
    <script src="{{ url_for('static', filename='vendors/fastclick/lib/fastclick.js') }}"></script>
    <script src="{{ url_for('static', filename='vendors/nprogress/nprogress.js') }}"></script>
    <script src="{{ url_for('static', filename='vendors/jquery.easy-pie-chart/dist/jquery.easypiechart.min.js') }}"></script>
    <script src="{{ url_for('static', filename='vendors/jquery-sparkline/dist/jquery.sparkline.min.js') }}"></script>
    <script src="{{ url_for('static', filename='js/admin.min.js') }}"></script>
    {% block footer %} {% endblock %}
  </body>
</html>